using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableNavigationItemDao:DaoBase<TableNavigationItem>
    {
        public override void AddPrimaryIndex(TableNavigationItem model)
        {
            cachePrimary[model.Id.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableNavigationItem.txt";
        }

        protected override TableNavigationItem ParseRowData(string[] rowData)
        {
            TableNavigationItem data = new TableNavigationItem();

            if (string.IsNullOrEmpty(rowData[0]))
            {
                data.Id = 0;
            }
            else
            {
                data.Id = int.Parse(rowData[0]);
            }
			data.Name = rowData [1];
			data.Desc = rowData [2];
			data.NpcId = rowData [3];

            if (string.IsNullOrEmpty(rowData[4]))
            {
                data.Index = 0;
            }
            else
            {
                data.Index = int.Parse(rowData[4]);
            }

            return data;
        }



    }

}
